{#第一个参数 pagination对象 第二个 跳转到哪里去#}
{% macro pagination_show(pagination,endpoint) %}
<nav aria-label="Page navigation">
  <ul class="pagination">
{#      上一页#}
    <li {% if not pagination.has_prev %} class="disabled" {% else %} {% endif %}>
      <a href="{% if pagination.has_prev %}{{ url_for(endpoint,page=pagination.prev_num,**kwargs) }}{% else %}#{% endif %}" aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
      </a>
    </li>
{#      中间页码 <1 2 3 4 5 6...10,11,12>#}
    {% for p in pagination.iter_pages() %}
        {% if p %}
{#            www.baidu.com?page=#}
            <li {% if pagination.page == p  %} class="active" {% endif %}><a href="{{ url_for(endpoint,page=p,**kwargs) }}">{{ p }}</a></li>
        {% else %}
            <li><a href="#">&hellip;</a></li>
        {% endif %}

    {% endfor %}
    



{#      下一页#}
   <li {% if not pagination.has_next %} class="disabled" {% else %}{% endif %}>
{#     127.0.0.1:5055/main?page=1&id#}
      <a href="{% if pagination.has_next %}{{ url_for(endpoint,page=pagination.next_num,**kwargs) }}{% else %}#{% endif %}" aria-label="Previous">
        <span aria-hidden="true">&raquo;</span>
      </a>
    </li>
  </ul>
</nav>

{% endmacro %}